package com.suke.czx.modules.tb.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonProperty;


/**
 * 用户消息私信表
 *
 * @author developer
 * @email developer@163.com
 * @date 2025-05-20 18:48:09
 */
@Data
@TableName("tb_message")
public class TbMessage implements Serializable {
    public static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "消息ID (主键, 自增)")
    @JsonProperty(value = "id")
    public Long id;

    @ApiModelProperty(value = "发送者ID (外键关联tb_user.id)")
    @JsonProperty(value = "senderId")
    public String senderId;

    @ApiModelProperty(value = "接收者ID (外键关联tb_user.id)")
    @JsonProperty(value = "receiverId")
    public String receiverId;

    @ApiModelProperty(value = "关联的商品ID (外键关联tb_product.id)")
    @JsonProperty(value = "productId")
    public Long productId;

    @ApiModelProperty(value = "消息内容")
    @JsonProperty(value = "content")
    public String content;

    @ApiModelProperty(value = "是否已读 (0-未读, 1-已读, 针对接收者)")
    @JsonProperty(value = "isRead")
    public Integer isRead;

    @ApiModelProperty(value = "发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(value = "createDate")
    public Date createDate;

    @ApiModelProperty(value = "消息类型")
    @JsonProperty(value = "contentType")
    public String contentType;

}
